package org.example.controller;

import org.example.model.Article;
import org.example.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/article")
public class ArticleController {

    //偷懒的做法：正式还是需要注入Service，由service调用mapper
    @Autowired
    private ArticleService articleService;

    @RequestMapping("/1to1")
    public Object oneToOne(){
        List<Article> articles = articleService.selectOneToOne();
        return articles;
    }
}
